﻿#include <iostream>
#include <ctime>
#include <exception>
#include <string>
#include <unordered_map>
#include <unordered_set>

using namespace std;

void test_unordered_multiset(long & value)
{
	cout << "\n test_unordered_multiset().... \n";

	unordered_multiset<string> c;
	char buf[10];
	clock_t timeStart = clock();
	for (long i = 0; i < value; i++)
	{
		try {
			snprintf(buf, 10, "%d", rand());
			c.insert(string(buf));
		}
		catch (exception& p) {
			cout << "i= " << i << " " << p.what() << endl;
			abort();
		}
	}

	cout << "milli-seconds : " << (clock() - timeStart) << endl;
	cout << " unordered_multiset.max_size()  " << c.max_size() << endl;
	cout << " unordered_multiset.size()  " << c.size() << endl;
	cout << " unordered_multiset.bucket_count()  " << c.bucket_count() << endl;

	for (size_t i = 0; i < 20; i++)
	{
		cout << " bucket size: " << c.bucket_size(i) << endl;
	}
}

int main(void)
{
	long value = 1000000;
	test_unordered_multiset(value);
	return 0;
}